package org.lai.controller;

import lombok.extern.slf4j.Slf4j;
import org.lai.pojo.OperateLog;
import org.lai.pojo.PageResult;
import org.lai.pojo.Result;
import org.lai.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RequestMapping("/log")
public class LogController {
    @Autowired
    private LogService logService;
    @GetMapping("/page")
    public Result getLogList(@RequestParam(defaultValue = "1" )Integer page,@RequestParam(defaultValue = "10") Integer pageSize){

        log.info("查询日志{},{}",page,pageSize);
        PageResult<OperateLog> result = logService.getLogList(page,pageSize);
        return Result.success(result);
    }
}
